<?php
/**

 //  The DoYouHaoBaby PHP FrameWork - page
 //  +---------------------------------------------------------------------
 //
 //  “Copyright”
 //  +---------------------------------------------------------------------
 //  | (C) 2010 - 2099 http://doyouhaobaby.net All rights reserved.
 //  | This is not a free software,use is subject to license terms
 //  +---------------------------------------------------------------------
 //
 //  “About This File”
 //  +---------------------------------------------------------------------
 //  | page Index控制器
 //  +---------------------------------------------------------------------

*/

!defined('DYHB_PATH') && exit;

class IndexController extends Controller{

	/**
	 * 首页 < 默认访问 >
	 *
	 * @access public
	 * @return void
	 */
	public function index(){
		// 获取总记录数
		$nTotalRecord=FormModel::F()->all()->getCounts();
		$nEveryNum=5;// 每页数量
		// 使用分页类
		$oPage=Page::RUN($nTotalRecord,$nEveryNum,G::getGpc('page','G'));
		$sPageNavbar=$oPage->P();
		// 获取数据列表
		$arrObjectList=FormModel::F()
				->all()
				->order('form_id DESC')
				->limit($oPage->returnPageStart(),$nEveryNum)
				->query();
		$this->assign('sPageNavbar',$sPageNavbar);
		$this->assign('arrObjectList',$arrObjectList);
		$this->display();
	}

}
